<?php

/**
 * @author @author Samrat Khan & Sadik Sarfaraz - Apr 15, 2013
 */
/**
 * 
 * @param numeric $id refers to numeric fixed values that used to select defferent response types
 * @param string $db Common database connection string parameter
 * @return string $CI returns unique name from responsetype table
 */
function getResponseTypes($id, $db) {
    $query = "SELECT responsetype_id, uniquename FROM responsetype WHERE cus_id = {$id}";
        try {
            $stmt = $db->prepare($query);
            $stmt->execute();
        } catch (PDOException $ex) {
            die("Failed to run query: " . $ex->getMessage());
        }
        $rows = $stmt->fetchAll();

        foreach($rows as $row1) {
            $CI.="<option value='{$row1["responsetype_id"]}'>";
                $CI.=$row1['uniquename'];
            $CI.="</option>";
            $CI++;
        }
        return $CI;
}
function addResponse() {
    
}
?>
